import request from "@/utils/request";

const api = {
  getMaterialTags: "/cms/category/tag/list",
  createMaterialTag: "/cms/category/tag/create",
  deleteMaterialTag: "/cms/category/tag/delete"
};

export function getMaterialTags(type) {
  /**
    POSTER: 获客海报
    ARTICLE: 获客文章
    VIDEO:  获客视频
    FILE:  获客文件
    HYPERLINK: 网页链接
    MINI_PROGRAM: 小程序链接
 */
  return request({
    url: api.getMaterialTags,
    params: {
      materialType: type
    }
  });
}

export function createMaterialTag(parameter) {
  return request({
    url: api.createMaterialTag,
    method: "put",
    data: parameter
  });
}

export function deleteMaterialTag({ id }) {
  return request({
    url: `${api.deleteMaterialTag}/${id}`,
    method: "delete"
  });
}
